package org.example.gradleadmin.rpc.service;

import gradle.common.core.mode.entity.SystemUser;
import jakarta.annotation.Resource;
import org.example.gradleadmin.mapper.SystemUserMapper;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service
public class SeataTransactionalService {

    @Resource
    private SystemUserMapper systemUserMapper;

    @Transactional
    public void addUser() {
        SystemUser systemUser = new SystemUser();
        systemUser.setLdapUuid("1");
        systemUser.setUsername("1");
        systemUser.setPassword("1");
        systemUser.setEmployeeName("1");
        systemUser.setEmployeeEmail("1");
        systemUser.setEmployeePhone("1");
        systemUser.setSystemOrganizationId(0L);
        systemUser.setEnable(1);
        systemUserMapper.insert(systemUser);
        if (1 == 1) {
            throw new RuntimeException();
        }

    }
}
